---
title: "Theming: Customising Selections"
---

Control how selected rows and cells appear.

## Row Selections

When [row selection](./row-selection/) is enabled, you can set the color of selected rows using the `selectedRowBackgroundColor` parameter. If your grid uses alternating row colours we recommend setting this to a semi-transparent colour so that the alternating row colours are visible below it.

```js
const myTheme = themeQuartz.withParams({
    // bright green, 10% opacity
    selectedRowBackgroundColor: 'rgba(0, 255, 0, 0.1)',

    // alternating row colors will be visible through the semi-transparent
    // selection background color
    oddRowBackgroundColor: '#8881',
});
```

{% gridExampleRunner title="Custom Row Selection Colour" name="custom-row-selection-color"  exampleHeight=450 /%}

## Cell Selections

[Cell selections](./cell-selection/) can be created by clicking and dragging on the grid. Copying from a selection will briefly highlight the range of cells ({% kbd "Ctrl + C" /%}). There are several parameters to control the selection and highlight style:

```js
const myTheme = themeQuartz.withParams({
    // color and style of border around selection
    rangeSelectionBorderColor: 'rgb(193, 0, 97)',
    rangeSelectionBorderStyle: 'dashed',
    // background color of selection - you can use a semi-transparent color
    // and it wil overlay on top of the existing cells
    rangeSelectionBackgroundColor: 'rgb(255, 0, 128, 0.1)',
    // color used to indicate that data has been copied form the cell range
    rangeSelectionHighlightColor: 'rgb(60, 188, 0, 0.3)',

    // alternating row colors will be visible through the semi-transparent
    // selection background color
    oddRowBackgroundColor: '#8881',
});
```

{% gridExampleRunner title="Custom Range Selection Style" name="custom-range-selection-style" /%}

### Cell Selection for Integrated Charts

When using [integrated charts](./integrated-charts/) with cell selections, the grid uses different colors to indicate the purpose of the cell ranges:

* `rangeSelectionChartBackgroundColor` - background color for cells used as chart data
* `rangeSelectionChartCategoryBackgroundColor` - background color for cells used as categories / axis labels
    